﻿<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output media-type="text/plain" method="text" indent="yes" encoding="utf-8" />
  <xsl:template match="/">
    <xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">]]></xsl:text>
    <html>
      <head>
        <xsl:text disable-output-escaping="yes"><![CDATA[<meta charset="utf-8">]]></xsl:text>
        <xsl:text disable-output-escaping="yes"><![CDATA[<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">]]></xsl:text>

        <title>Type Listing</title>

        <xsl:text disable-output-escaping="yes"><![CDATA[<meta name="description" content="">]]></xsl:text>
        <xsl:text disable-output-escaping="yes"><![CDATA[<meta name="viewport" content="width=device-width">]]></xsl:text>

        <style type="text/css">
          <xsl:comment>Styles here </xsl:comment>
        </style>

      </head>
      <body>
        <xsl:apply-templates select="TypeListing" />

      </body>
    </html>

  </xsl:template>

  <xsl:template match="TypeListing">
    <div id="header">
      <h1>
        <xsl:value-of select="@Name" />
      </h1>

      <xsl:call-template name="navigation" />
    </div>

    <xsl:apply-templates select="Namespaces" />

    <div id="footer">
      <xsl:call-template name="navigation" />
    </div>

  </xsl:template>


  <!-- Top level changes -->

  <xsl:template match="Namespaces">

    <xsl:apply-templates select="Namespace" />

  </xsl:template>

  <xsl:template match="Namespace">

    <h2>
      <xsl:value-of select="@Name" />
    </h2>
    <xsl:apply-templates select="Types" />

  </xsl:template>

  <xsl:template match="Types">

    <ul>
      <xsl:apply-templates select="Type" />
    </ul>

  </xsl:template>

  <xsl:template match="Type">

    <li>
      <xsl:value-of select="@Name" />
    </li>

  </xsl:template>

  <xsl:template name="navigation">
    <div id="navigation">
      <ul>
        <li>
          <a>
            <xsl:attribute name="href">
              <xsl:value-of select="@SummaryName" />.html
            </xsl:attribute>Summary
          </a>
        </li>
        <li>
          <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
        </li>
        <li>
          <a>
            <xsl:attribute name="href">
              <xsl:value-of select="@AssemblyName" />.html
            </xsl:attribute>
            <xsl:value-of select="@AssemblyName" />
          </a>
        </li>
      </ul>
    </div>
  </xsl:template>

</xsl:stylesheet>
